package com.ybkj.o2o.zhuanche.entity;

import com.ybkj.o2o.zhuanche.common.json.DateTimeJsonSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Date;

public class Car implements Serializable {
    private Long id;
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date created;// 创建时间
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date updated;// 修改时间

    private Long companyId;// 公司ID

    private String companyName;// 公司名称

    private String carName;// 车辆名称

    private String carNumber;// 车牌号

    private Integer status;// 0 空闲 ,1 忙碌 , 2 离线

    private Long carTypeId;// 车辆类型ID

    private String carTypeName;// 车辆类型名称

    private Double drivingDistance;// 已行驶公里数
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date buyTime;// 购买时间

    private Long employId;// 服务人员ID

    private String employName;// 服务人员名字

    private Integer limitLine;// 限行
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date insuranceTime;// 保险日期
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date overhaulTime;// 年检日期(本次年检)

    private String picture;// 车辆照片(45度角彩色)

    private String platePictureAddress;// 车牌照片

    private String provincial;// 省

    private String city;// 市

    private String county;// 县

    private String address;// 具体地址

    private Long version;// 版本

    private String appKey;

    private static final long serialVersionUID = 1L;

    // 为符合政府监管要求添加的字段
    private String plateColor; // 车牌颜色

    private String brand; // 车辆厂牌

    private String vehicleType; // 车辆类型

    private String vehicleModel; // 车辆型号

    private String owner; // 所属车主

    private String driverProType;// 车辆归属

    private String bodyColor; // 车身颜色

    private String engineNo; // 车辆发动机号

    private String vin; // 车辆识别VIN码

    private String fuel; // 车辆燃料类型

    private String permitted; // 核定载客位
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date registrationTime; // 注册日期

    private Integer inspectioStatus; // 年验状态 0:未年审,1:年审合格,2:年审不合格

    private Integer rateType; // 运价类型 0:未知

    private String vehicleStatus; // 状态,YY运营,TC退出

    private String displacement; // 车辆发动机排量

    private Double totalMileage; // 车辆行驶总里程

    private Integer maintenanceStatus; // 车辆检修状态 0:未检修,1:已检修,2:其他
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date nextOverhaulTime; // 下次年检时间(下次年检)

    private String taxiNo; // 网络预约出租汽车运输证号

    private String taxiAgency; // 网络预约出租汽车运输证发证机构

    private String taxiRegion; // 经营区域
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date validTime; // 网络预约出租汽车运输证有效期起
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date invalidTime; // 网络预约出租汽车运输证有效期止
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date taxiRegisterTime; // 网约车初次登记日期

    private String deviceSerial; // 网约车发票打印设备序列号

    private String deviceBrand; // 卫星定位装置品牌

    private String deviceModel; // 卫星定位装置型号
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date deviceInstallTime; // 卫星定位装置安装日期

    private String insurer; // 保险公司

    private String insuranceNo; // 保险号

    private String insType; // 保险类型

    private Double insMoney; // 保险金额

    // 增加租赁公司

    private Long rentalCompanyId; // 租赁公司id

    private String rentalCompanyName; // 租赁公司名称

    private Boolean report;// 是否上报

    private String gpsIMEI;// 卫星定位装置IEMI号

    private String flights;// 倒班班次

    private Integer upStatus;// 监管平台上传标识

    private String pictureTransport;

    public String getPictureTransport() {
        return pictureTransport;
    }

    public void setPictureTransport(String pictureTransport) {
        this.pictureTransport = pictureTransport;
    }

    public String getPlatePictureAddress() {
        return platePictureAddress;
    }

    public void setPlatePictureAddress(String platePictureAddress) {
        this.platePictureAddress = platePictureAddress;
    }

    public Integer getUpStatus() {
        return upStatus;
    }

    public void setUpStatus(Integer upStatus) {
        this.upStatus = upStatus;
    }

    public String getFlights() {
        return flights;
    }

    public void setFlights(String flights) {
        this.flights = flights;
    }

    public String getGpsIMEI() {
        return gpsIMEI;
    }

    public void setGpsIMEI(String gpsIMEI) {
        this.gpsIMEI = gpsIMEI;
    }

    public Boolean getReport() {
        return report;
    }

    public void setReport(Boolean report) {
        this.report = report;
    }

    public Long getRentalCompanyId() {
        return rentalCompanyId;
    }

    public void setRentalCompanyId(Long rentalCompanyId) {
        this.rentalCompanyId = rentalCompanyId;
    }

    public String getRentalCompanyName() {
        return rentalCompanyName;
    }

    public void setRentalCompanyName(String rentalCompanyName) {
        this.rentalCompanyName = rentalCompanyName;
    }

    @JsonSerialize(using = DateTimeJsonSerializer.class)
    private Date insValidTime; // 保险生效时间

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName == null ? null : companyName.trim();
    }

    public String getCarName() {
        return carName;
    }

    public void setCarName(String carName) {
        this.carName = carName == null ? null : carName.trim();
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber == null ? null : carNumber.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getCarTypeId() {
        return carTypeId;
    }

    public void setCarTypeId(Long carTypeId) {
        this.carTypeId = carTypeId;
    }

    /**
     * 没有车型时返回.
     */

    public String getCarTypeName() {
        if (StringUtils.isNotBlank(carTypeName)) {
            return carTypeName;
        } else {
            return "车型已删除";
        }
    }

    public void setCarTypeName(String carTypeName) {
        this.carTypeName = carTypeName;
    }

    public Double getDrivingDistance() {
        return drivingDistance;
    }

    public void setDrivingDistance(Double drivingDistance) {
        this.drivingDistance = drivingDistance;
    }

    public Date getBuyTime() {
        return buyTime;
    }

    public void setBuyTime(Date buyTime) {
        this.buyTime = buyTime;
    }

    public Long getEmployId() {
        return employId;
    }

    public void setEmployId(Long employId) {
        this.employId = employId;
    }

    public String getEmployName() {
        return employName;
    }

    public void setEmployName(String employName) {
        this.employName = employName == null ? null : employName.trim();
    }

    public Integer getLimitLine() {
        return limitLine;
    }

    public void setLimitLine(Integer limitLine) {
        this.limitLine = limitLine;
    }

    public Date getInsuranceTime() {
        return insuranceTime;
    }

    public void setInsuranceTime(Date insuranceTime) {
        this.insuranceTime = insuranceTime;
    }

    public Date getOverhaulTime() {
        return overhaulTime;
    }

    public void setOverhaulTime(Date overhaulTime) {
        this.overhaulTime = overhaulTime;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture == null ? null : picture.trim();
    }

    public String getProvincial() {
        return provincial;
    }

    public void setProvincial(String provincial) {
        this.provincial = provincial == null ? null : provincial.trim();
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city == null ? null : city.trim();
    }

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        this.county = county == null ? null : county.trim();
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address == null ? null : address.trim();
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey == null ? null : appKey.trim();
    }

    // 新增参数
    public String getPlateColor() {
        return plateColor;
    }

    public void setPlateColor(String plateColor) {
        this.plateColor = plateColor;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getVehicleType() {
        return vehicleType;
    }

    public void setVehicleType(String vehicleType) {
        this.vehicleType = vehicleType;
    }

    public String getVehicleModel() {
        return vehicleModel;
    }

    public void setVehicleModel(String vehicleModel) {
        this.vehicleModel = vehicleModel;
    }

    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    public String getBodyColor() {
        return bodyColor;
    }

    public void setBodyColor(String bodyColor) {
        this.bodyColor = bodyColor;
    }

    public String getEngineNo() {
        return engineNo;
    }

    public void setEngineNo(String engineNo) {
        this.engineNo = engineNo;
    }

    public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public String getFuel() {
        return fuel;
    }

    public void setFuel(String fuel) {
        this.fuel = fuel;
    }

    public String getPermitted() {
        return permitted;
    }

    public void setPermitted(String permitted) {
        this.permitted = permitted;
    }

    public Date getRegistrationTime() {
        return registrationTime;
    }

    public void setRegistrationTime(Date registrationTime) {
        this.registrationTime = registrationTime;
    }

    public Integer getInspectioStatus() {
        return inspectioStatus;
    }

    public void setInspectioStatus(Integer inspectioStatus) {
        this.inspectioStatus = inspectioStatus;
    }

    public Integer getRateType() {
        return rateType;
    }

    public void setRateType(Integer rateType) {
        this.rateType = rateType;
    }

    public String getDisplacement() {
        return displacement;
    }

    public void setDisplacement(String displacement) {
        this.displacement = displacement;
    }

    public Double getTotalMileage() {
        return totalMileage;
    }

    public void setTotalMileage(Double totalMileage) {
        this.totalMileage = totalMileage;
    }

    public Integer getMaintenanceStatus() {
        return maintenanceStatus;
    }

    public void setMaintenanceStatus(Integer maintenanceStatus) {
        this.maintenanceStatus = maintenanceStatus;
    }

    public Date getNextOverhaulTime() {
        return nextOverhaulTime;
    }

    public void setNextOverhaulTime(Date nextOverhaulTime) {
        this.nextOverhaulTime = nextOverhaulTime;
    }

    public String getTaxiNo() {
        return taxiNo;
    }

    public void setTaxiNo(String taxiNo) {
        this.taxiNo = taxiNo;
    }

    public String getTaxiAgency() {
        return taxiAgency;
    }

    public void setTaxiAgency(String taxiAgency) {
        this.taxiAgency = taxiAgency;
    }

    public String getTaxiRegion() {
        return taxiRegion;
    }

    public void setTaxiRegion(String taxiRegion) {
        this.taxiRegion = taxiRegion;
    }

    public Date getValidTime() {
        return validTime;
    }

    public void setValidTime(Date validTime) {
        this.validTime = validTime;
    }

    public Date getInvalidTime() {
        return invalidTime;
    }

    public void setInvalidTime(Date invalidTime) {
        this.invalidTime = invalidTime;
    }

    public Date getTaxiRegisterTime() {
        return taxiRegisterTime;
    }

    public void setTaxiRegisterTime(Date taxiRegisterTime) {
        this.taxiRegisterTime = taxiRegisterTime;
    }

    public String getDeviceSerial() {
        return deviceSerial;
    }

    public void setDeviceSerial(String deviceSerial) {
        this.deviceSerial = deviceSerial;
    }

    public String getDeviceBrand() {
        return deviceBrand;
    }

    public void setDeviceBrand(String deviceBrand) {
        this.deviceBrand = deviceBrand;
    }

    public String getDeviceModel() {
        return deviceModel;
    }

    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }

    public Date getDeviceInstallTime() {
        return deviceInstallTime;
    }

    public void setDeviceInstallTime(Date deviceInstallTime) {
        this.deviceInstallTime = deviceInstallTime;
    }

    public String getInsurer() {
        return insurer;
    }

    public void setInsurer(String insurer) {
        this.insurer = insurer;
    }

    public String getInsuranceNo() {
        return insuranceNo;
    }

    public void setInsuranceNo(String insuranceNo) {
        this.insuranceNo = insuranceNo;
    }

    public String getInsType() {
        return insType;
    }

    public void setInsType(String insType) {
        this.insType = insType;
    }

    public Double getInsMoney() {
        return insMoney;
    }

    public void setInsMoney(Double insMoney) {
        this.insMoney = insMoney;
    }

    public Date getInsValidTime() {
        return insValidTime;
    }

    public void setInsValidTime(Date insValidTime) {
        this.insValidTime = insValidTime;
    }

    public String getDriverProType() {
        return driverProType;
    }

    public void setDriverProType(String driverProType) {
        this.driverProType = driverProType;
    }

    public String getVehicleStatus() {
        return vehicleStatus;
    }

    public void setVehicleStatus(String vehicleStatus) {
        this.vehicleStatus = vehicleStatus;
    }

    @Override
    public String toString() {
        return "Car [id=" + id + ", created=" + created + ", updated=" + updated + ", companyId=" + companyId
                + ", companyName=" + companyName + ", carName=" + carName + ", carNumber=" + carNumber + ", status="
                + status + ", carTypeId=" + carTypeId + ", carTypeName=" + carTypeName + ", drivingDistance="
                + drivingDistance + ", buyTime=" + buyTime + ", employId=" + employId + ", employName=" + employName
                + ", limitLine=" + limitLine + ", insuranceTime=" + insuranceTime + ", overhaulTime=" + overhaulTime
                + ", picture=" + picture + ", provincial=" + provincial + ", city=" + city + ", county=" + county
                + ", address=" + address + ", version=" + version + ", appKey=" + appKey + ", plateColor=" + plateColor
                + ", brand=" + brand + ", vehicleType=" + vehicleType + ", vehicleModel=" + vehicleModel + ", owner="
                + owner + ", driverProType=" + driverProType + ", bodyColor=" + bodyColor + ", engineNo=" + engineNo
                + ", vin=" + vin + ", fuel=" + fuel + ", permitted=" + permitted + ", registrationTime="
                + registrationTime + ", inspectioStatus=" + inspectioStatus + ", rateType=" + rateType
                + ", vehicleStatus=" + vehicleStatus + ", displacement=" + displacement + ", totalMileage="
                + totalMileage + ", maintenanceStatus=" + maintenanceStatus + ", nextOverhaulTime=" + nextOverhaulTime
                + ", taxiNo=" + taxiNo + ", taxiAgency=" + taxiAgency + ", taxiRegion=" + taxiRegion + ", validTime="
                + validTime + ", invalidTime=" + invalidTime + ", taxiRegisterTime=" + taxiRegisterTime
                + ", deviceSerial=" + deviceSerial + ", deviceBrand=" + deviceBrand + ", deviceModel=" + deviceModel
                + ", deviceInstallTime=" + deviceInstallTime + ", insurer=" + insurer + ", insuranceNo=" + insuranceNo
                + ", insType=" + insType + ", insMoney=" + insMoney + ", rentalCompanyId=" + rentalCompanyId
                + ", rentalCompanyName=" + rentalCompanyName + ", report=" + report + ", gpsIMEI=" + gpsIMEI
                + ", flights=" + flights + ", insValidTime=" + insValidTime + "]";
    }
}
